package com.sinosoft.hydra.um.constant;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 14-3-17
 * Time: 上午10:30
 * To change this template use File | Settings | File Templates.
 */
public class BaseConstant {

    public static final Integer INTEGER_SUCCESS = 1;
    public static final Integer INTEGER_TRUE = INTEGER_SUCCESS;
    public static final Integer INTEGER_FALSE = 0;
    public static final String STRING_FALSE = INTEGER_FALSE + "";
    public static final String STRING_TRUE = INTEGER_TRUE + "";

    public static enum EBomType {
        E_BOM_TYPE_BUILD,
        E_BOM_TYPE_UN_BUILD
    }

    /**
     * 结果 成功 失败
     */
    public static enum Result {
        RESULT_SUCCESS,    //成功
        RESULT_FAILURE     //失败
    }

    /**
     * 结果 成功 失败
     */
    public static enum BomStatus {
        UN_PUBLISH,    //未发布（草稿）
        PUBLISH,     //已发布（正式）
        DESTROY,     //销毁,
        RECYCLE       //已回收
    }

    /**
     * 结果 成功 失败
     */
    public static enum SaveType {
        SAVE_TYPE_ADD,    //新增
        SAVE_TYPE_UPDATE     //修改
    }

    /**
     * 结果 成功 失败
     */
    public static enum UseAble {
        USE_ABLE_UNABLE,    //成功
        USE_ABLE_ENABLE     //失败
    }

    /**
     * 结果 成功 失败
     */
    public static enum Boolean {
        BOOLEAN_TRUE(1),    //成功
        BOOLEAN_FALSE(0);     //失败

        private Integer value;

        Boolean(Integer value) {
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }
    }

    /**
     * 消息类型 用户发送  系统发送
     */
    public static enum MessageType {
        MESSAGE_TYPE_USER,
        MESSAGE_TYPE_SYSTEM
    }

    /**
     * 消息发送方式  邮箱 站内信 短信
     */
    public static enum MessageSendType {
        MESSAGE_SEND_TYPE_EMAIL,
        MESSAGE_SEND_TYPE_NOTICE,
        MESSAGE_SEND_TYPE_PHONE
    }

    /**
     * 文档是否发布，未发布的只有本部门可见，并且不能下载
     */
    public static enum DocStatus {
        DOC_STATUS_PUBLISHED,
        DOC_STATUS_UN_PUBLISHED
    }

    /**
     * 消息发送状态 已发送 未发送
     */
    public static enum MessageSendStatus {
        MESSAGE_SEND_STATUS_SENT,
        MESSAGE_SEND_STATUS_NON_SEND
    }

    /**
     * 消息阅读状态 已读 未读
     */
    public static enum MessageReadStatus {
        MESSAGE_READ_STATUS_READ,
        MESSAGE_READ_STATUS_NON_READ
    }

    public static enum FileConvertStatus {
        FILE_CONVERT_STATUS_SUCCESS,
        FILE_CONVERT_STATUS_WORKING,
        FILE_CONVERT_STATUS_FAILURE
    }

    public static enum FileType {
        FILE_TYPE_DOCUMENT,
        FILE_TYPE_ATTACHMENT,
        FILE_TYPE_TEMP
    }

    public static enum LabelType {
        LABEL_TYPE_TEXT,
        LABEL_TYPE_IMG
    }

    public static enum FiledType {
        FIELD_TYPE_TEXT("字符串"),
        FIELD_TYPE_TEXTAREA("文本"),
        FIELD_TYPE_TIME("时间"),
        FIELD_TYPE_NUM("数字"),
        FIELD_TYPE_ATTACHMENT("附件"),
        FIELD_TYPE_SCIENTIFIC("科学计数法"),
        FIELD_TYPE_TABLE("表格"),
        FIELD_TYPE_DIRECTORY("数据字典");

        private String value;

        FiledType(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }


    public static enum ResourceType {
        MENU("menu"),
        BUTTON("button");

        private String value;

        ResourceType(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }

    /**
     * 文档可见范围类型
     * 0-所有人 1-仅自己 2-仅所属部门 3-部分用户
     */
    public static enum DocRangeType {
        ALL_USERS(0),
        ONLY_SELF(1),
        ONLY_ORG(2),
        SOME_USERS(3);

        private Integer value;

        DocRangeType(Integer value) {
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }
    }

    public static enum RecordType {
        RECORD_TYPE_NORMAL,
        RECORD_TYPE_BEST
    }

    public static enum DataParseStatus {
        SUCCESS_LOAD_DATA,
        SUCCESS_DRAW,
        WORKING,
        FAILURE
    }

    public static enum ParseFailureMsg {
        FILE_NOT_FOUND,
        DATA_NOT_FOUND,
        PARSE_EXCEPTION
    }

    public static final String MD5 = "1";
    public static final String SHA_1 = "2";
    public static final String SHA_256 = "3";


    public static final String timePatterns[] = new String[]
            {"yyyy/MM/dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy-MM-dd HH:mm",
                    "yyyy-MM-dd", "yyyy/MM/dd", "yyyyMMdd", "yyyyMMddHHmm", "yyyyMMddHHmmss"};
}
